package com.sugar.follow.up.module.business.dal.mysql.doctor;

import java.util.*;

import com.sugar.follow.up.framework.common.pojo.PageResult;
import com.sugar.follow.up.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.sugar.follow.up.framework.mybatis.core.mapper.BaseMapperX;
import com.sugar.follow.up.module.business.dal.dataobject.doctor.DoctorDO;
import org.apache.ibatis.annotations.Mapper;
import com.sugar.follow.up.module.business.controller.admin.doctor.vo.*;

/**
 * 医生 Mapper
 *
 * @author Ysugar
 */
@Mapper
public interface DoctorMapper extends BaseMapperX<DoctorDO> {

    default PageResult<DoctorDO> selectPage(DoctorPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DoctorDO>()
                .likeIfPresent(DoctorDO::getName, reqVO.getName())
                .likeIfPresent(DoctorDO::getPostName, reqVO.getPostName())
                .eqIfPresent(DoctorDO::getBeGoodAt, reqVO.getBeGoodAt())
                .eqIfPresent(DoctorDO::getBriefInfo, reqVO.getBriefInfo())
                .betweenIfPresent(DoctorDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DoctorDO::getId));
    }

}